require "import"
import "tools"
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(0xff4DB6AC)
activity.setContentView("pTransform_")
format={"png","jpg","jpeg","ts","bmp","tiff","aiff","gif"}
adp=ArrayAdapter(activity,android.R.layout.simple_spinner_item, String(format))
adp.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
transform.background=btBackground
sp.Adapter=adp
oDir.text=LUA_SD.."/avHandle/output/"
iDir.onClick=function()
  ChoiceFile(LUA_SD,function(dir)
    iDir.text=dir
  end)
end
oDir.onClick=function()
  ChoicePath(LUA_SD,function(dir)
    oDir.text=dir.."/"
  end)
end
transform.onClick=function()
  if File(iDir.text).exists()
    if filename.text~=""
      local cmd="-i "..iDir.text.." -y "..oDir.text..filename.text.."."..sp.getSelectedItem()
      activity.newActivity("handle",{cmd})
     else
      print("请输入文件名")
    end
   else
    print("目标文件不存在")
  end
end
